package structure.decorator;

public class Demo {

    public static void main(String[] args) {
        // 新建一个武将
        WujiangComponent wujiangComponent = new Wujiang();
        // 坚守者
        WujiangDecortor wujiangDecortor = new Adherents(wujiangComponent);
        wujiangDecortor.attack();
        wujiangDecortor.move();
        wujiangDecortor.defense();

        // 攻击者 + 防御者
        wujiangDecortor = new Charger(new Adherents(wujiangComponent));
        wujiangDecortor.attack();
        wujiangDecortor.move();
        wujiangDecortor.defense();
    }
}
